import axios from 'axios';
import { baseURL } from '../utils/http.js'; // 引入基础URL


export const getOrderByUserid = (userid) => {
    console.log(`管理端根据用户id查询订单访问地址${baseURL}/order/getOrderByUserid`); // 使用基础URL
    return axios.get(`${baseURL}/order/getOrderByUserid`, {
        params: {
            userid: userid
        }
    });
};

export const getOrderProductByOrderid = (orderid) => {
    console.log(`管理端根据订单id查询订单商品访问地址${baseURL}/order/getOrderProductByOrderid`); // 使用基础URL
    return axios.get(`${baseURL}/order/getOrderProductByOrderid`, {
        params: {
            orderid: orderid
        }
    });
};

export const updateOrderStatus = (orderid, status) => {
    console.log(`管理端根据订单id修改订单状态访问地址${baseURL}/order/updateOrderStatus`); // 使用基础URL
    return axios.put(`${baseURL}/order/updateOrderStatus`, {
        orderid: orderid,
        status: status
    });
};
